package cn.fintecher.pangolin.entity.mysql;

import cn.fintecher.pangolin.common.enums.AssistStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.*;
import java.util.Date;

@Data
@Entity
@Table(name = "assist_case")
@ApiModel(value = "assist_case", description = "协催案件信息")
public class AssistCase extends BaseEntity {

    @ApiModelProperty(notes = "案件Id")
    private String caseId;

    @ApiModelProperty(value = "案件编号")
    private String caseNumber;

    @ApiModelProperty(notes = "催计数")
    @Field(type = FieldType.Integer)
    private Integer collectionRecordCount = 0;

    @ApiModelProperty("姓名")
    private String personalName;

    @ApiModelProperty(value = "性别")
    private String sex;

    @ApiModelProperty("人员Id")
    private String personalId;

    @ApiModelProperty("身份证号码")
    private String certificateNo;

    @ApiModelProperty("批次号")
    private String batchNumber;

    @ApiModelProperty(notes = "委托方Id")
    private String principalId;

    @ApiModelProperty(notes = "委托方名")
    private String principalName;

    @ApiModelProperty(notes = "逾期期数")
    private Integer overduePeriods;

    @ApiModelProperty(notes = "逾期天数")
    private Integer overdueDays;

    @ApiModelProperty(notes = "卡号")
    private String cardNo;

    @ApiModelProperty(notes = "委案金额")
    private Double overdueAmtTotal;

    @ApiModelProperty(notes = "欠款金额")
    private Double leftAmt;

    @ApiModelProperty(notes = "最后还款金额")
    private Double latestPayAmt;

    @ApiModelProperty(value = "最后还款日期")
    private Date latestPayDate;

    @ApiModelProperty(notes = "协助状态")
    @Enumerated(EnumType.STRING)
    private AssistStatus assistStatus;

    @ApiModelProperty(notes = "催收员姓名")
    private String currentCollector;

    @ApiModelProperty(notes = "催收员部门")
    private String collectorDepartmentName;

    @ApiModelProperty("协催地址")
    private String addressDetail;

    @ApiModelProperty("地址类型")
    private String addressType;

    @ApiModelProperty("关系")
    private String relation;

    @ApiModelProperty(notes = "电话")
    private String phone;

    @ApiModelProperty("地址Id")
    private String personalAddressId;

    @ApiModelProperty("联系电话Id")
    private String personalContactId;

    @ApiModelProperty(notes = "协催催收员")
    @OneToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "assist_collector_id")
    private User assistCollector;

    @ApiModelProperty("申请原因")
    private String applyReason;

    @ApiModelProperty("外访开始时间")
    private Date visitTimeStart;

    @ApiModelProperty("外访到期时间")
    private Date visitTimeEnd;

    @ApiModelProperty("申请人姓名")
    private String applyRealName;

    @ApiModelProperty(notes = "操作员")
    private String operator;

    @ApiModelProperty(notes = "操作时间")
    private Date operatorTime;

    @ApiModelProperty(value = "最新联络结果")
    private String lastContactResult;

    @ApiModelProperty(value = "最新联络时间")
    private Date lastContactDate;
}
